set(TEST_NAME ${PROJECT_NAME}_test)
set(COVR_NAME ${PROJECT_NAME}_coverage)
set(DEMO_NAME ${PROJECT_NAME}_demo)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

set(INC_DIR ${PROJECT_SOURCE_DIR}/lib)
include_directories(${INC_DIR})

if(${CMAKE_BUILD_TYPE} MATCHES "Coverage")
        set(LIB_DIR ../lib)
        set(SRC_LIST ${LIB_DIR}/bplustree.c bplustree_coverage.c)
        add_executable(${COVR_NAME} ${SRC_LIST})
        set(CMAKE_C_FLAGS "-O2 -Wall --coverage")
        include(CodeCoverage)
        setup_target_for_coverage(coverage ${COVR_NAME} coverage)
else()
        set(SRC_LIST bplustree_demo.c)
        add_executable(${DEMO_NAME} ${SRC_LIST})
        set(CMAKE_C_FLAGS "-O2 -Wall -Werror -Wextra")
        target_link_libraries(${DEMO_NAME} ${LIB_BPLUSTREE_NAME})
endif()
